package com.computaris.ws;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name = "EVENTS")
public class Event implements java.io.Serializable {
	private Integer id;
	private Long subsriberId;
	private Integer type;
	private Integer charge;
	private Integer amount;
	private Integer uom;
	private Date eventDate;
	
	public Event() {
		
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "TYPE", nullable = false)
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EVENT_DATE")
	public Date getEventDate() {
		return this.eventDate;
	}

	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}
	
	@Column(name = "CHARGE", nullable = false)
	public Integer getCharge() {
		return charge;
	}

	public void setCharge(Integer charge) {
		this.charge = charge;
	}

	@Column(name = "AMOUNT", nullable = true)
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}
	
	@Column(name = "UOM", nullable = false)
	public Integer getUom() {
		return uom;
	}

	public void setUom(Integer uom) {
		this.uom = uom;
	}

	@Column(name = "SUBSCRIBER_ID", nullable = false)
	public Long getSubsriberId() {
		return subsriberId;
	}

	public void setSubsriberId(Long subsriberId) {
		this.subsriberId = subsriberId;
	}
	
	@Override
	public String toString() {
		return this.amount + " - " + this.charge + " - " + this.eventDate + " - " + this.subsriberId + " - " + this.type + " - " + this.uom;
	}
}
